Skip to content

Add a keyless public MCP endpoint - #681

Open
kvz wants to merge 5 commits into
mainfrom
mcp-public
Open

kvz wants to merge 5 commits into
mainfrom
mcp-public

Conversation

@kvz

@kvz kvz commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Why

Coding agents can look up public Robot documentation and lint Assembly Instructions over hosted MCP before connecting a Workspace. A separate keyless route preserves the OAuth challenge and discovery flow on /mcp.

DSP-1652. Chosen design and questions for Tim and default-off search decision.

Changes

Product code. Embedders can configure publicPath on the Node HTTP handler. Its public server card and tools/list advertise the same three local tools: transloadit_list_robots, transloadit_get_robot_help, and transloadit_lint_assembly_instructions. The public server registers only its allowlist and omits Workspace discovery and resources. Express and CLI entry points retain their existing routes. A later API2 PR wires up hosting and the rate limiter after the SDK package is released.

Security considerations

The default public tools use no outbound HTTP, including linting Instructions that mention external URLs. The public route requires a host-supplied rate limiter and fails closed on errors or after two seconds. The callback receives an abort signal for timeouts, disconnects, and shutdown. All public POSTs, including invalid messages, count toward the caller’s budget. The limiter receives request headers and the socket address before the handler reads the body. The route caps bodies at 128 KiB, rejects batches, ignores Authorization before dispatch, defaults to wildcard CORS without credentials, honors an explicit origin allowlist, and returns 405 for an SSE GET. Public lint caps fix work and bounds its formatted diagnostics while computing the verdict from all issues. Robot list and help have bounded inputs.

The existing OAuth challenge remains on /mcp. Its HTTP boundary checks for a bearer value, and API2 validates that value when tools make account calls. The API2 hosting PR needs to verify tokens before /mcp bypasses public limits if that separation is enforced at deployment. Embedders configure the Node HTTP server’s body-read timeout.

Tim’s hosting decision. publicDocsSearch defaults to false. API2 can explicitly enable it after Tim approves first-party egress for anonymous callers. It adds only transloadit_search_docs. On a cache miss, search sends the query to the fixed first-party https://transloadit.com/api/docs/search/ endpoint with redirects disabled. It shares a five-minute, 500-entry cache and ten concurrent upstream slots across public server instances. An abandoned coalesced request can hold a slot until the upstream completes or its ten-second deadline expires. Search stays docs-only. Individual page retrieval, registry remotes, and the hosted rate-limit budget are covered by the design discussion.

Plan and implementation details

The checked-out MCP package requires Node 22 or newer. Its existing search already uses the fixed URL, response bounds, and timeout, so this PR wraps it in a cache for the optional public search. Robot help accepts a legacy comma-separated argument as well as an array, so both forms receive a five-name limit. The Express router and the Node HTTP handler have separate request plumbing. The new options belong to the Node handler, where embedders can pass a callback. The Node SDK bounds diagnostic hydration using the serialized MCP issue format, so the public tool returns every diagnostic that fits its 32 KiB budget.

Validation

The initial red regression suite confirmed the unconfigured public route returned 404. The HTTP tests use a real Streamable HTTP client and cover the OAuth challenge, discovery and the server card, public and denied tools, CORS, SSE refusal, quotas, shutdown, and input and diagnostic limits. The default-profile test watches both fetch and Node HTTP for outbound requests. Optional search uses a stub at the outbound fetch boundary.

yarn check, the MCP TypeScript check, and all 423 MCP unit tests passed locally. The 60 focused HTTP and linter tests also passed on Node 22.23.5. The built SDK linter passed a smoke test on Node 20.10. The change adds 511 runtime lines. SDK CI for 1542d57c passed all 14 applicable checks on x64.

Council

  • Round 1. Kevin chose the separate, default-off search opt-in. Added the limiter deadline and cancellation, typed server-card compatibility, lint work and diagnostic bounds, and default-profile egress coverage.
  • Round 2. Addressed shutdown during admission and body reads, bounded Robot help validation, returned schema-valid missing Robot responses, matched discovery with the MCP handshake, and moved the lint diagnostic budget into hydration.
  • Round 3. Fixed request settlement during shutdown, isolated limiter metadata from the body stream, based the lint budget on serialized MCP issues, made CORS honor explicit origins and cache correctly, and rejected unsupported public routes in Express. Documented gateway token validation and host body-read deadlines. The final batch was checked locally after this round.

🤖 Claimed by kvz on framework1/node-sdk since 2026-11-29 · resume: codex resume 01a226fb-da1c-7272-bad4-4104e8d6e26c

@kvz kvz self-assigned this Nov 29, 2026
@kvz
kvz marked this pull request as ready for review November 29, 2026 12:41
@kvz
kvz requested a review from tim-kos November 29, 2026 12:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant